// http-proxy-middleware
// 是一个代理中间件，用于转发请求，将客户端发送的请求数据转发到目标服务器，再将相应输送到
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = (app) => {
    app.use(
        "/api",
        createProxyMiddleware({
            target: 'http://localhost:8005',
            changeOrigin: true,
            pathRewrite: {
                '^/api': ''
            }
        })
    )
}